From: Keir Fraser Date: Tue, 21 Oct 2008 10:39:22 +0000 (+0100) Subject: x86: Avoid dynamic memory allocation during AP startup. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14066^2~7 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=35bb5ffbddc9a1331ccdfb51c2129c4d9da4fcd6;p=xen.git x86: Avoid dynamic memory allocation during AP startup. Signed-off-by: Keir Fraser --- diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 69218fd322..d7360ec29c 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -473,13 +473,6 @@ static void construct_percpu_idt(unsigned int cpu) { unsigned char idt_load[10]; - /* If IDT table exists since last hotplug, reuse it */ - if (!idt_tables[cpu]) { - idt_tables[cpu] = xmalloc_array(idt_entry_t, IDT_ENTRIES); - memcpy(idt_tables[cpu], idt_table, - IDT_ENTRIES*sizeof(idt_entry_t)); - } - *(unsigned short *)(&idt_load[0]) = (IDT_ENTRIES*sizeof(idt_entry_t))-1; *(unsigned long *)(&idt_load[2]) = (unsigned long)idt_tables[cpu]; __asm__ __volatile__ ( "lidt %0" : "=m" (idt_load) ); @@ -908,6 +901,12 @@ static int __devinit do_boot_cpu(int apicid, int cpu) } #endif + if (!idt_tables[cpu]) { + idt_tables[cpu] = xmalloc_array(idt_entry_t, IDT_ENTRIES); + memcpy(idt_tables[cpu], idt_table, + IDT_ENTRIES*sizeof(idt_entry_t)); + } + /* * This grunge runs the startup process for * the targeted processor.